import cv2 as cv
import numpy as np

pic = "E:\Study\OpenCV\opencv\sources\samples\data\opencv-logo.png"
image = cv.imread(pic)
rgbchl= cv.split(image)
zeros = np.empty(image.shape[:2],"uint8")
b = cv.merge([rgbchl[0],zeros,zeros])
g = cv.merge([zeros,rgbchl[1],zeros])
r = cv.merge([zeros,zeros,rgbchl[2]])
image = cv.resize(image,(0,0),fx=0.5,fy=0.5)
b = cv.resize(b,(0,0),fx=0.5,fy=0.5)
g = cv.resize(g,(0,0),fx=0.5,fy=0.5)
r = cv.resize(r,(0,0),fx=0.5,fy=0.5)
cv.imshow("Origin",image)
cv.imshow("B",b)
cv.imshow("G",g)
cv.imshow("R",r)
cv.waitKey(0)